﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestUpLoad.aspx.cs" Inherits="TaiChySystem.Web.Site.ComPage.TestUpLoad" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../App_Themes/Common_CSS/style/Upload.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../JS/swfupload/swfupload.js"></script>
    <script type="text/javascript" src="../JS/swfupload/swfupload.queue.js"></script>
    <script type="text/javascript" src="../JS/swfupload/fileprogress.js"></script>
    <script type="text/javascript" src="../JS/swfupload/handlers.js"></script>
    <script language="javascript" type="text/javascript">
        var swfu;

        window.onload = function () {
            var settings = {
                flash_url: "../JS/swfupload/swfupload.swf",
                flash9_url: "../JS/swfupload/swfupload_FP9.swf", // Relative to this file
                upload_url: "upload.aspx",
                post_params: {
                   
                },
                file_size_limit: "100 MB",
                file_types: "*.jpg;*.gif;*.png",    //这是全部文件都可以上传，如果要限制只有某些文件上传，则可以这么写 file_types : "*.jpg;*.gif;*.png",
                file_types_description: "All Files",
                file_upload_limit: 100,
                file_queue_limit: 0,
                custom_settings: {
                    progressTarget: "fsUploadProgress",
                    cancelButtonId: "btnCancel"
                },
                debug: false,


                // Button settings

                //这儿是swfupload v2新增加的功能，由于flash player 10的安全性的提高所以增加了此功能。

                //在SWFUpload v2中，不能再使用html的button来触发SWFUpload，必须使用定制的Button，这其中比较要注意的是，button不能再用css控制，需要用图片来显示

                button_image_url: "../App_Themes/Common_CSS/style/XPButtonNoText_160x22.png",
                button_placeholder_id: "spanButtonPlaceHolder",
                button_width: 160,
                button_height: 22,
                button_text: '<span class="button">&nbsp; &nbsp;选择文件 &nbsp;  &nbsp;<span class="buttonSmall">(2 MB Max)</span></span>',
                button_text_style: '.button { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }',
                button_text_top_padding: 1,
                button_text_left_padding: 5,

                // The event handler functions are defined in handlers.js
                file_queued_handler: fileQueued,
                file_queue_error_handler: fileQueueError,
                file_dialog_complete_handler: fileDialogComplete,
                upload_start_handler: uploadStart,
                upload_progress_handler: uploadProgress,
                upload_error_handler: uploadError,
                upload_success_handler: uploadSuccess,
                upload_complete_handler: uploadComplete,
                queue_complete_handler: queueComplete    // Queue plugin event
            };

            swfu = new SWFUpload(settings);
        };

        function CloseTopDialog() {
            var win = window;
            while (win.parent != null && win.parent != win) {
                win = win.parent;
            }
            var $jParent = win.jQuery.noConflict();
            $jParent("#externalSite").dialog('close');
        }
    </script>
</head>
<body  style="background-color: #FFFFFF; background-image: none; ">
    <div id="content">
        <h2>
            一次选择多个文件进行上传</h2>
        <form id="form1" runat="Server">
        <div>
            <span id="spanButtonPlaceHolder"></span>
            <input id="btnCancel" type="button" value="取消全部上传" onclick="swfu.cancelQueue();"
                disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 22px;" />
        </div>
        <p>
            &nbsp;</p>
        <div class="fieldset flash" id="fsUploadProgress">
            <span class="legend">Upload Queue</span>
        </div>
        <div id="divStatus">
            0 个文件已经上传</div>
        <div class="controlBar" align="center">
            <table cellpadding="0" cellspacing="0" style="width: 200px; margin: 0 auto;">
                <tr>
                    <td align="center">
                        <label class="btnStylec png_bg">
                            <asp:Button ID="btnOk" runat="server" Text="确定" OnClick="btnOk_Click" />
                        </label>
                        <label class="btnStyleb png_bg">
                            <input type="button" id="Button1" value="返回" onclick="CloseTopDialog();" />
                        </label>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </div>
</body>
</html>
